home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mint112s.zoo / makefile < prev    next >
Encoding:
Makefile  |  1994-11-15  |  7.2 KB  |  254 lines

  1. #
  2. # Makefile for MiNT using the GCC
  3. #
  4.  
  5. # if you're cross-compiling, define NATIVECC
  6. # to the host's C compiler, NATIVECFLAGS to
  7. # the appropriate flags for it, and NATIVELIBS
  8. # to appropriate libraries
  9. # NATIVECC = cc -DNO_STDLIB
  10. # NATIVECFLAGS = -g
  11. # NATIVELIBS =
  12.  
  13. NATIVECC = gcc
  14. NATIVECFLAGS = -O
  15. NATIVELIBS = -liio
  16.  
  17. #
  18. # depending on your version of bison/yacc, you may
  19. # need to change these names, e.g. to
  20. # YACC = yacc
  21. # YTABC = y.tab.c
  22. # YTABH = y.tab.h
  23.  
  24. #YACC = bison
  25. #YTABC = asm_tab.c
  26. #YTABH = asm_tab.h
  27.  
  28. YACC = byacc -b y_
  29. YTABC = y_tab.c
  30. YTABH = y_tab.h
  31.  
  32. # here are defs for the cross compiler
  33. # MiNT must be compiled with 16 bit integers
  34.  
  35. CC = gcc
  36. AS = gcc
  37. MODEL = -mshort
  38. MODEL030 = -mshort -m68020
  39. LIBS = -liio16
  40.  
  41. # add -DMULTITOS for a MultiTOS kernel
  42. # add -DONLY030 for a version of MiNT that needs a 680x0, x>=3
  43. # add -DDEBUG_INFO for debugging information
  44. # add -DFASTTEXT for the u:\dev\fasttext fast console driver
  45.  
  46. DEFS = -DDEBUG_INFO
  47. #DEFS030 = -DONLY030
  48.  
  49. #
  50. # if you have an older version of gcc, it won't understand -G;
  51. # that won't hurt anything (it just controls the format of the
  52. # symbol table) so just delete the -G. Do *not* change it into
  53. # -g!!!
  54. #
  55. CFLAGS = -G -Wall -Wmissing-prototypes -O2 -fomit-frame-pointer $(MODEL) $(DEFS)
  56. ASFLAGS = $(MODEL)
  57. CFLAGS030 = -G -Wall -Wmissing-prototypes -O2 -fomit-frame-pointer $(MODEL030) $(DEFS030)
  58. ASFLAGS030 = $(MODEL030)
  59.  
  60. COBJS = bios.o xbios.o console.o dos.o dosdir.o dosfile.o dosmem.o dossig.o \
  61.     filesys.o main.o mem.o proc.o signal.o timeout.o tty.o util.o \
  62.     biosfs.o pipefs.o procfs.o tosfs.o debug.o rendez.o \
  63.     unifs.o shmfs.o fasttext.o welcome.o nalloc2.o memprot.o realloc.o
  64.  
  65. COBJS030 = bios.o0 xbios.o0 console.o0 dos.o0 dosdir.o0 dosfile.o0 dosmem.o0 dossig.o0 \
  66.     filesys.o0 main.o0 mem.o0 proc.o0 signal.o0 timeout.o0 tty.o0 util.o0 \
  67.     biosfs.o0 pipefs.o0 procfs.o0 tosfs.o0 debug.o0 rendez.o0 \
  68.     unifs.o0 shmfs.o0 fasttext.o0 welcome.o0 nalloc2.o0 memprot.o realloc.o0
  69.  
  70. CFILES = bios.c xbios.c console.c dos.c dosdir.c dosfile.c dosmem.c dossig.c \
  71.     filesys.c main.c mem.c proc.c signal.c timeout.c tty.c util.c \
  72.     biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c \
  73.     unifs.c shmfs.c fasttext.c welcome.c nalloc2.c memprot.c realloc.c
  74.  
  75. HFILES = assert.h atarierr.h basepage.h cookie.h ctype.h debug.h fasttext.h \
  76.     file.h inline.h loadave.h mem.h mint.h proc.h proto.h signal.h sproto.h \
  77.     types.h version.h xbra.h
  78.  
  79. SFILES = context.spp cpu.spp intr.spp syscall.spp quickzer.spp \
  80.     quickmov.spp magic.i
  81.  
  82. SOBJS = context.o intr.o syscall.o quickzer.o quickmov.o cpu.o
  83. SOBJS030 = context.o0 intr.o0 syscall.o0 quickzer.o0 quickmov.o0 cpu.o0
  84.  
  85. OBJS = $(COBJS) $(SOBJS)
  86. OBJS030 = $(COBJS030) $(SOBJS030)
  87.  
  88. #all: mint.prg mint030.prg
  89.  
  90. mint.prg: $(OBJS)
  91.     $(CC) $(CFLAGS) -o mint.prg $(OBJS) $(LIBS)
  92. #    strip mint.prg
  93.  
  94. mint030.prg: $(OBJS030)
  95.     $(CC) $(CFLAGS030) -o mint030.prg $(OBJS030) $(LIBS)
  96. #    strip mint030.prg
  97.  
  98. $(SOBJS): proc.h
  99. $(COBJS): mint.h proc.h file.h debug.h
  100.  
  101. $(SOBJS030): proc.h
  102. $(COBJS030): mint.h proc.h file.h debug.h
  103.  
  104. main.o: version.h
  105. welcome.o: version.h
  106. bios.o: inline.h
  107. proc.o dos.o: loadave.h
  108.  
  109. memprot.o: memprot.c mint.h proc.h file.h
  110.     $(CC) $(CFLAGS) -m68020 -c memprot.c
  111.  
  112. main.o0: version.h
  113. welcome.o0: version.h
  114. bios.o0: inline.h
  115. proc.o0 dos.o0: loadave.h
  116.  
  117. #
  118. # assembler source files are now handled in a radically different
  119. # fashion. We build a pre-processor program, asmtrans, that
  120. # takes the .spp files, merges them with an include file that
  121. # gives various offsets into structures of interest, and produces
  122. # the .s files as output. This has two major advantages:
  123. # (1) it lets us use the same source for both the Lattice and
  124. #     gcc assembler files (the translator will convert), and
  125. # (2) if we change the CONTEXT or PROC structures, we don't
  126. #     have to dig through the source code looking for
  127. #     magic numbers
  128.  
  129. # the asm translator program
  130. # Note that this must be compiled with the native CC of whatever
  131. # system you're using; see the definitions at the top of this
  132. # file.
  133.  
  134. ATRANSOBJ = asmtab.o trutil.o trans.o
  135. ATRANS = asmtrans.ttp
  136. ATRANSSRC = asm.y asmtab.c asmtab.h asmtrans.h trutil.c trans.c
  137.  
  138. $(ATRANS): $(ATRANSOBJ)
  139.     $(NATIVECC) $(NATIVECFLAGS) -o $(ATRANS) $(ATRANSOBJ) \
  140.         $(NATIVELIBS)
  141.  
  142. asmtab.o: asmtab.c asmtrans.h
  143.     $(NATIVECC) $(NATIVECFLAGS) -o $@ -c asmtab.c
  144.  
  145. trutil.o: trutil.c asmtrans.h
  146.     $(NATIVECC) $(NATIVECFLAGS) -o $@ -c trutil.c
  147.  
  148. trans.o: trans.c asmtrans.h
  149.     $(NATIVECC) $(NATIVECFLAGS) -o $@ -c trans.c
  150.  
  151.  
  152. asmtab.c asmtab.h:    asm.y
  153.     $(YACC) -d asm.y
  154.     mv $(YTABC) asmtab.c
  155.     mv $(YTABH) asmtab.h
  156.  
  157. # the magic number include file is generated automagically
  158. #
  159. # NOTE that of course, magic.i can only reliably be generated
  160. # on an Atari ST; if you're cross-compiling, you'll have
  161. # to edit magic.i by hand (unless your machine's native compiler
  162. # happens to generate exactly the same offsets for structures as
  163. # its Atari cross compiler, which is *extremely* unlikely).
  164. # magic.i only needs to be updated if the structures in proc.h
  165. # change; otherwise, you can use the supplied magic.i.
  166. # If you do need to generate a new magic.i, cross-compile genmagic.ttp,
  167. # run it on an ST, and bring the output back to your cross compiler.
  168. #
  169. # for cross compilers; uncomment the following definitions
  170. # and comment out the other ones below
  171.  
  172. # for cross-compiling
  173.  
  174. # GENMAGICPRG=echo
  175. # magic.i: proc.h file.h genmagic.c
  176. #    echo "Warning: magic.i may be out of date"
  177.  
  178. #for native compiling
  179.  
  180. GENMAGICPRG=genmagic.ttp
  181.  
  182. $(GENMAGICPRG): genmagic.c proc.h file.h
  183.     $(CC) $(CFLAGS) -DGENMAGIC -o $(GENMAGICPRG) genmagic.c
  184.  
  185. magic.i: $(GENMAGICPRG)
  186.     $(GENMAGICPRG) $@
  187.  
  188. #
  189. # assembler source files
  190. #
  191. .SUFFIXES: .spp .o0
  192.  
  193. .spp.o:
  194.     $(ATRANS) $(DEFS) -gas -o $*.s $<
  195.     $(AS) $(ASFLAGS) -o $@ -c $*.s
  196.     $(RM) $*.s
  197. .spp.o0:
  198.     $(ATRANS) $(DEFS030) -gas -o $*.s $<
  199.     $(AS) $(ASFLAGS0) -o $@ -c $*.s
  200.     $(RM) $*.s
  201. .c.o0:
  202.     $(CC) $(CFLAGS030) -o $@ -c $<
  203.  
  204. context.o: context.spp magic.i $(ATRANS)
  205. intr.o: intr.spp magic.i $(ATRANS)
  206. syscall.o: syscall.spp magic.i $(ATRANS)
  207. quickzer.o: quickzer.spp $(ATRANS)
  208. quickmov.o: quickmov.spp $(ATRANS)
  209. cpu.o: cpu.spp $(ATRANS)
  210.  
  211. context.o0: context.spp magic.i $(ATRANS)
  212. intr.o0: intr.spp magic.i $(ATRANS)
  213. syscall.o0: syscall.spp magic.i $(ATRANS)
  214. quickzer.o0: quickzer.spp $(ATRANS)
  215. quickmov.o0: quickmov.spp $(ATRANS)
  216. cpu.o0: cpu.spp $(ATRANS)
  217.  
  218. #
  219. # mkptypes generates prototypes from C source code. If you don't have it,
  220. # you'll have to add/delete function prototypes by hand.
  221. # also: Sozobon users will have to edit proto.h by hand to change the
  222. #    #if defined(__STDC__) || defined(__cplusplus)
  223. # line into
  224. #    #if __STDC__
  225. #
  226. proto.h: $(CFILES)
  227.     mkptypes $(CFILES) >proto.h
  228.  
  229. #
  230. # macros for cleaning up
  231. #
  232. GENFILES= $(OBJS) $(OBJS030) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG)
  233. EXTRAS= asmtab.c asmtab.h mint.prg
  234.  
  235. clean:
  236.     $(RM) $(GENFILES)
  237.  
  238. realclean:
  239.     $(RM) $(GENFILES) $(EXTRAS)
  240.  
  241. #
  242. # misc. files and subdirectories to include in the distribution
  243. #
  244. MISCFILES = copying readme.src changes makefile makefile.lcc mintlc.prj \
  245.     genmagic.c purec asmtrans.ttp
  246.  
  247. #
  248. # macros for making distribution packages
  249. #
  250.  
  251. dist:
  252.     zoo a//h mintsrc.zoo $(MISCFILES) $(CFILES) $(HFILES) $(SFILES) \
  253.      $(ATRANSSRC)
  254.